package com.woshua.aopmodel;

import android.content.Intent;
import android.os.SystemClock;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.woshua.aopmodel.aspect.BehaviorTrace;
import com.woshua.aopmodel.utils.SumUtils;

public class MainActivity extends AppCompatActivity {

    public static final String TAG="MainActivity";


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @BehaviorTrace("摇一摇")
    public void onShake(View view) {

        {
            Log.d("MainActivity","摇到妹子");
            SystemClock.sleep(200);
        }

    }

    @BehaviorTrace("语音通话")
    public void onVoice(View view) {

        {
            Log.d("MainActivity","语音通话妹子");
            SystemClock.sleep(300);
        }

    }

    @BehaviorTrace("视频通话")
    public void onVideo(View view) {

        {
            Log.d("MainActivity","视频通话妹子");
            SystemClock.sleep(100);
        }

    }

    /*
    * 代理模式
    * */
    @BehaviorTrace("发短信")
    public void onTextSend(View view) {

        {
            Log.d("MainActivity","发短信妹子");
            SystemClock.sleep(20);
        }

    }

    public void onJump(View view) {
        Intent intent=new Intent(this,FriendsActivity.class);
        startActivity(intent);
    }
}
